import { TableCustom } from '@vh-admin/pro-components';
import { columnsFn } from './define';
import { backupsDownload, backupsIndex } from '@/services/sys/backups';
import access from '@/access';
const { checkPermissionAuth } = access();

function Backups() {
  return (
    <>
      <TableCustom<any>
        request={backupsIndex}
        columns={columnsFn()}
        search={false}
        operationConfig={{
          download: {
            auth: () => {
              return checkPermissionAuth({ accessId: 31 });
            },
            modalConfig: {
              modalType: 'Download',
              edit: true,
              config: {
                submitRequest: backupsDownload,
              },
            },
          },
        }}
      />
    </>
  );
}

export default Backups;
